package com.huanghwh.sync.core.entity;

import cn.hutool.core.util.IdUtil;
import cn.hutool.db.Entity;

import java.util.Date;

/**
 * @Author: huanghwh
 * @Date: 2021/12/24 13:55
 * @Description: 日志表常量
 */
public class SyncLog {

     public static final String ID = "ID";

     public static final String TABLE_NAME = "TABLE_NAME";

     public static final String TABLE_ID = "TABLE_ID";

     public static final String REMARK = "REMARK";

     public static final String CREATE_TIME = "CREATE_TIME";


     /**
      * 生成日志实体
      *
      * @param tableId
      * @param tableName
      * @param remark
      * @return
      * @Author huanghwh
      * @Date 2021/12/24 14:46
      */
     public static Entity createLogEntity(String tableId, String tableName, String remark) {
        Entity entity = Entity.create();
        entity.set(ID, IdUtil.randomUUID());
        entity.set(TABLE_NAME, tableName);
        entity.set(TABLE_ID, tableId);
        entity.set(REMARK, remark);
        entity.set(CREATE_TIME, new Date());
        entity.setTableName("DB_SYNC_LOG");
        return entity;
     }
}
